home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / SpeechRecognition.a < prev    next >
Encoding:
Text File  |  1996-05-03  |  23.4 KB  |  757 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        SpeechRecognition.a
  3. ;
  4. ;    Contains:    Apple Speech Recognition Toolbox Interfaces.
  5. ;
  6. ;    Version:    Technology:    PlainTalk 1.5
  7. ;                Package:    Universal Interfaces 2.1.3
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.     IF &TYPE('__SPEECHRECOGNITION__') = 'UNDEFINED' THEN
  20. __SPEECHRECOGNITION__ SET 1
  21.  
  22.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  23.     include 'Memory.a'
  24.     ENDIF
  25.  
  26. gestaltSpeechRecognitionVersion    EQU        'srtb'
  27. gestaltSpeechRecognitionAttr    EQU        'srta'
  28.  
  29. gestaltDesktopSpeechRecognition    EQU        $00000001
  30. gestaltTelephoneSpeechRecognition EQU    $00000002
  31. ;  Error Codes [Speech recognition gets -5100 through -5199] 
  32.  
  33. kSRNotAvailable                    EQU        -5100                ; the service requested is not avail or applicable 
  34. kSRInternalError                EQU        -5101                ; a system internal or hardware error condition 
  35. kSRComponentNotFound            EQU        -5102                ; a needed system resource was not located 
  36. kSROutOfMemory                    EQU        -5103                ; an out of memory error occurred in the toolbox memory space 
  37. kSRNotASpeechObject                EQU        -5104                ; the object specified is no longer or never was valid 
  38. kSRBadParameter                    EQU        -5105                ; an invalid parameter was specified 
  39. kSRParamOutOfRange                EQU        -5106                ; when we say 0-100, don't pass in 101. 
  40. kSRBadSelector                    EQU        -5107                ; an unrecognized selector was specified 
  41. kSRBufferTooSmall                EQU        -5108                ; returned from attribute access functions 
  42. kSRNotARecSystem                EQU        -5109                ; the object used was not a SRRecognitionSystem 
  43. kSRFeedbackNotAvail                EQU        -5110                ; there is no feedback window associated with SRRecognizer 
  44. kSRCantSetProperty                EQU        -5111                ; a non-settable property was specified 
  45. kSRCantGetProperty                EQU        -5112                ; a non-gettable property was specified 
  46. kSRCantSetDuringRecognition        EQU        -5113                ; the property can't be set while recognition is in progress -- do before or between utterances. 
  47. kSRAlreadyListening                EQU        -5114                ; in response to SRStartListening 
  48. kSRNotListeningState            EQU        -5115                ; in response to SRStopListening 
  49. kSRModelMismatch                EQU        -5116                ; no acoustical models are avail to match request 
  50. kSRNoClientLanguageModel        EQU        -5117                ; trying to access a non-specified SRLanguageModel 
  51. kSRNoPendingUtterances            EQU        -5118                ; nothing to continue search on 
  52. kSRRecognitionCanceled            EQU        -5119                ; an abort error occurred during search 
  53. kSRRecognitionDone                EQU        -5120                ; search has finished, but nothing was recognized 
  54. kSROtherRecAlreadyModal            EQU        -5121                ; another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now 
  55. kSRHasNoSubItems                EQU        -5122                ; SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. 
  56. kSRSubItemNotFound                EQU        -5123                ; returned when accessing a non-existent sub item of a container 
  57. kSRLanguageModelTooBig            EQU        -5124                ; Cant build language models so big 
  58. kSRAlreadyReleased                EQU        -5125                ; this object has already been released before 
  59. kSRAlreadyFinished                EQU        -5126                ; the language model can't be finished twice 
  60. kSRWordNotFound                    EQU        -5127                ; the spelling couldn't be found in lookup(s) 
  61. kSRNotFinishedWithRejection        EQU        -5128                ; property not found because the LMObj is not finished with rejection 
  62. kSRExpansionTooDeep                EQU        -5129                ; Language model is left recursive or is embedded too many levels 
  63. kSRTooManyElements                EQU        -5130                ; Too many elements added to phrase or path or other langauge model object 
  64. kSRCantAdd                        EQU        -5131                ; Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    
  65. kSRSndInSourceDisconnected        EQU        -5132                ; Sound input source is disconnected 
  66. kSRCantReadLanguageObject        EQU        -5133                ; An error while trying to create new Language object from file or pointer -- possibly bad format 
  67.                                                             ; non-release debugging error codes are included here 
  68. kSRNotImplementedYet            EQU        -5199                ; you'd better wait for this feature in a future release 
  69. ;  Type Definitions 
  70.  
  71.  
  72. ; typedef SRSpeechObject                 SRRecognitionSystem
  73.  
  74. ; typedef SRSpeechObject                 SRRecognizer
  75.  
  76. ; typedef SRSpeechObject                 SRSpeechSource
  77.  
  78. ; typedef SRSpeechSource                 SRRecognitionResult
  79.  
  80. ; typedef SRSpeechObject                 SRLanguageObject
  81.  
  82. ; typedef SRLanguageObject                 SRLanguageModel
  83.  
  84. ; typedef SRLanguageObject                 SRPath
  85.  
  86. ; typedef SRLanguageObject                 SRPhrase
  87.  
  88. ; typedef SRLanguageObject                 SRWord
  89.  
  90. ;  between 0 and 100 
  91. ; typedef unsigned short                 SRSpeedSetting
  92.  
  93. ;  between 0 and 100 
  94. ; typedef unsigned short                 SRRejectionLevel
  95.  
  96. ;  When an event occurs, the user supplied proc will be called with a pointer    
  97. ;     to the param passed in and a flag to indicate conditions such                
  98. ;     as interrupt time or system background time.                                
  99. SRCallBackStruct        RECORD 0
  100. what                     ds.l    1                ; offset: $0 (0)        ;  one of notification flags 
  101. message                     ds.l    1                ; offset: $4 (4)        ;  contains SRRecognitionResult id 
  102. instance                 ds.l    1                ; offset: $8 (8)        ;  ID of recognizer being notified 
  103. status                     ds.w    1                ; offset: $C (12)        ;  result status of last search 
  104. flags                     ds.w    1                ; offset: $E (14)        ;  non-zero if occurs during interrupt 
  105. refCon                     ds.l    1                ; offset: $10 (16)        ;  user defined - set from SRCallBackParam 
  106. sizeof                     EQU *                    ; size:   $14 (20)
  107.                         ENDR
  108. ;  Call back procedure definition 
  109. SRCallBackParam            RECORD 0
  110. callBack                 ds.l    1                ; offset: $0 (0)
  111. refCon                     ds.l    1                ; offset: $4 (4)
  112. sizeof                     EQU *                    ; size:   $8 (8)
  113.                         ENDR
  114. ;  Recognition System Types 
  115.  
  116. kSRDefaultRecognitionSystemID    EQU        0
  117. ;  Recognition System Properties 
  118.  
  119. kSRFeedbackAndListeningModes    EQU        'fbwn'                ; short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes 
  120. kSRRejectedWord                    EQU        'rejq'                ; the SRWord used to represent a rejection 
  121. kSRCleanupOnClientExit            EQU        'clup'                ; Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits 
  122.  
  123. kSRNoFeedbackNoListenModes        EQU        0                    ; next allocated recognizer has no feedback window and doesn't use listening modes    
  124. kSRHasFeedbackHasListenModes    EQU        1                    ; next allocated recognizer has feedback window and uses listening modes             
  125. kSRNoFeedbackHasListenModes        EQU        2                    ; next allocated recognizer has no feedback window but does use listening modes     
  126. ;  Speech Source Types 
  127.  
  128. kSRDefaultSpeechSource            EQU        0
  129. kSRLiveDesktopSpeechSource        EQU        'dklv'                ; live desktop sound input 
  130. kSRCanned22kHzSpeechSource        EQU        'ca22'                ; AIFF file based 16 bit, 22.050 KHz sound input 
  131. ;  Notification via Apple Event or Callback 
  132. ;  Notification Flags 
  133.  
  134. kSRNotifyRecognitionBeginning    EQU        $00000001            ; recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition 
  135. kSRNotifyRecognitionDone        EQU        $00000002            ; recognition has terminated. result (if any) is available. 
  136. ;  Apple Event selectors 
  137. ;  AppleEvent message class  
  138.  
  139. kAESpeechSuite                    EQU        'sprc'
  140. ;  AppleEvent message event ids 
  141.  
  142. kAESpeechDone                    EQU        'srsd'
  143. kAESpeechDetected                EQU        'srbd'
  144. ;  AppleEvent Parameter ids 
  145.  
  146. keySRRecognizer                    EQU        'krec'
  147. keySRSpeechResult                EQU        'kspr'
  148. keySRSpeechStatus                EQU        'ksst'
  149. ;  AppleEvent Parameter types 
  150.  
  151. typeSRRecognizer                EQU        'trec'
  152. typeSRSpeechResult                EQU        'tspr'
  153. ;  SRRecognizer Properties 
  154.  
  155. kSRNotificationParam            EQU        'noti'                ; see notification flags below 
  156. kSRCallBackParam                EQU        'call'                ; type SRCallBackParam 
  157. kSRSearchStatusParam            EQU        'stat'                ; see status flags below 
  158. kSRAutoFinishingParam            EQU        'afin'                ; automatic finishing applied on LM for search 
  159. kSRForegroundOnly                EQU        'fgon'                ; Boolean. Default is true. If true, client recognizer only active when in foreground.    
  160. kSRBlockBackground                EQU        'blbg'                ; Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    
  161. kSRBlockModally                    EQU        'blmd'                ; Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! 
  162. kSRWantsResultTextDrawn            EQU        'txfb'                ; Boolean. Default is true. If true, search results are posted to Feedback window 
  163. kSRWantsAutoFBGestures            EQU        'dfbr'                ; Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior 
  164. kSRSoundInVolume                EQU        'volu'                ; short in [0..100] log scaled sound input power. Can't set this property 
  165. kSRReadAudioFSSpec                EQU        'aurd'                ; *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF 
  166. kSRCancelOnSoundOut                EQU        'caso'                ; Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. 
  167. kSRSpeedVsAccuracyParam            EQU        'sped'                ; SRSpeedSetting between 0 and 100 
  168. ;  0 means more accurate but slower. 
  169. ;  100 means (much) less accurate but faster. 
  170.  
  171. kSRUseToggleListen                EQU        0                    ; listen key modes 
  172. kSRUsePushToTalk                EQU        1
  173.  
  174. kSRListenKeyMode                EQU        'lkmd'                ; short: either kSRUseToggleListen or kSRUsePushToTalk 
  175. kSRListenKeyCombo                EQU        'lkey'                ; short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message 
  176. kSRListenKeyName                EQU        'lnam'                ; Str63: string representing ListenKeyCombo 
  177. kSRKeyWord                        EQU        'kwrd'                ; Str255: keyword preceding spoken commands in kSRUseToggleListen mode 
  178. kSRKeyExpected                    EQU        'kexp'                ; Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? 
  179. ;  Operational Status Flags 
  180.  
  181. kSRIdleRecognizer                EQU        $00000001            ; engine is not active 
  182. kSRSearchInProgress                EQU        $00000002            ; search is in progress 
  183. kSRSearchWaitForAllClients        EQU        $00000004            ; search is suspended waiting on all clients' input 
  184. kSRMustCancelSearch                EQU        $00000008            ; something has occurred (sound played, non-speech detected) requiring the search to abort 
  185. kSRPendingSearch                EQU        $00000010            ; we're about to start searching 
  186. ;  Recognition Result Properties 
  187.  
  188. kSRTEXTFormat                    EQU        'TEXT'                ; raw text in user supplied memory 
  189. kSRPhraseFormat                    EQU        'lmph'                ; SRPhrase containing result words 
  190. kSRPathFormat                    EQU        'lmpt'                ; SRPath containing result phrases or words 
  191. kSRLanguageModelFormat            EQU        'lmfm'                ; top level SRLanguageModel for post parse 
  192. ;  SRLanguageObject Family Properties 
  193.  
  194. kSRSpelling                        EQU        'spel'                ; spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel 
  195. kSRLMObjType                    EQU        'lmtp'                ; Returns one of SRLanguageObject Types listed below 
  196. kSRRefCon                        EQU        'refc'                ; 4 bytes of user storage 
  197. kSROptional                        EQU        'optl'                ; Boolean -- true if SRLanguageObject is optional    
  198. kSREnabled                        EQU        'enbl'                ; Boolean -- true if SRLanguageObject enabled 
  199. kSRRepeatable                    EQU        'rptb'                ; Boolean -- true if SRLanguageObject is repeatable 
  200. kSRRejectable                    EQU        'rjbl'                ; Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord 
  201.                                                             ;        object can be returned in place of SRLanguageObject with this property)    
  202. kSRRejectionLevel                EQU        'rjct'                ; SRRejectionLevel between 0 and 100 
  203. ;  LM Object Types -- returned as kSRLMObjType property of language model objects 
  204.  
  205. kSRLanguageModelType            EQU        'lmob'                ; SRLanguageModel 
  206. kSRPathType                        EQU        'path'                ; SRPath 
  207. kSRPhraseType                    EQU        'phra'                ; SRPhrase 
  208. kSRWordType                        EQU        'word'                ; SRWord 
  209. ;  a normal and reasonable rejection level 
  210.  
  211. kSRDefaultRejectionLevel        EQU        50
  212. ; ******************************************************************************
  213. ;                         NOTES ON USING THE API                                    
  214. ;                                                                                 
  215. ;         All operations (with the exception of SRGetRecognitionSystem) are        
  216. ;         directed toward an object allocated or begot from New, Get and Read        
  217. ;         type calls.                                                                
  218. ;                                                                                 
  219. ;         There is a simple rule in dealing with allocation and disposal:            
  220. ;                                                                                 
  221. ;         *    all toolbox allocations are obtained from a SRRecognitionSystem        
  222. ;                                                                                 
  223. ;         *    if you obtain an object via New or Get, then you own a reference     
  224. ;             to that object and it must be released via SRReleaseObject when        
  225. ;             you no longer need it                                                
  226. ;                                                                                 
  227. ;         *    when you receive a SRRecognitionResult object via AppleEvent or        
  228. ;             callback, it has essentially been created on your behalf and so        
  229. ;             you are responsible for releasing it as above                        
  230. ;                                                                                 
  231. ;         *    when you close a SRRecognitionSystem, all remaining objects which        
  232. ;             were allocated with it will be forcefully released and any            
  233. ;             remaining references to those objects will be invalid.                
  234. ;                                                                                 
  235. ;         This translates into a very simple guideline:                            
  236. ;             If you allocate it or have it allocated for you, you must release    
  237. ;             it.  If you are only peeking at it, then don't release it.            
  238. ;                                                                                 
  239. ; ******************************************************************************
  240. ;  Opening and Closing of the SRRecognitionSystem 
  241. ;
  242. ; pascal OSErr SROpenRecognitionSystem(SRRecognitionSystem *system, OSType systemID)
  243. ;
  244.     IF ¬ GENERATINGCFM THEN
  245.         Macro
  246.         _SROpenRecognitionSystem
  247.             move.w              #$0400,d0
  248.             dc.w                $AA56
  249.         EndM
  250.     ELSE
  251.         IMPORT_CFM_FUNCTION SROpenRecognitionSystem
  252.     ENDIF
  253.  
  254. ;
  255. ; pascal OSErr SRCloseRecognitionSystem(SRRecognitionSystem system)
  256. ;
  257.     IF ¬ GENERATINGCFM THEN
  258.         Macro
  259.         _SRCloseRecognitionSystem
  260.             move.w              #$0201,d0
  261.             dc.w                $AA56
  262.         EndM
  263.     ELSE
  264.         IMPORT_CFM_FUNCTION SRCloseRecognitionSystem
  265.     ENDIF
  266.  
  267. ;  Accessing Properties of any Speech Object 
  268. ;
  269. ; pascal OSErr SRSetProperty(SRSpeechObject srObject, OSType selector, const void *property, Size propertyLen)
  270. ;
  271.     IF ¬ GENERATINGCFM THEN
  272.         Macro
  273.         _SRSetProperty
  274.             move.w              #$0802,d0
  275.             dc.w                $AA56
  276.         EndM
  277.     ELSE
  278.         IMPORT_CFM_FUNCTION SRSetProperty
  279.     ENDIF
  280.  
  281. ;
  282. ; pascal OSErr SRGetProperty(SRSpeechObject srObject, OSType selector, void *property, Size *propertyLen)
  283. ;
  284.     IF ¬ GENERATINGCFM THEN
  285.         Macro
  286.         _SRGetProperty
  287.             move.w              #$0803,d0
  288.             dc.w                $AA56
  289.         EndM
  290.     ELSE
  291.         IMPORT_CFM_FUNCTION SRGetProperty
  292.     ENDIF
  293.  
  294. ;  Any object obtained via New or Get type calls must be released 
  295. ;
  296. ; pascal OSErr SRReleaseObject(SRSpeechObject srObject)
  297. ;
  298.     IF ¬ GENERATINGCFM THEN
  299.         Macro
  300.         _SRReleaseObject
  301.             move.w              #$0204,d0
  302.             dc.w                $AA56
  303.         EndM
  304.     ELSE
  305.         IMPORT_CFM_FUNCTION SRReleaseObject
  306.     ENDIF
  307.  
  308. ;
  309. ; pascal OSErr SRGetReference(SRSpeechObject srObject, SRSpeechObject *newObjectRef)
  310. ;
  311.     IF ¬ GENERATINGCFM THEN
  312.         Macro
  313.         _SRGetReference
  314.             move.w              #$0425,d0
  315.             dc.w                $AA56
  316.         EndM
  317.     ELSE
  318.         IMPORT_CFM_FUNCTION SRGetReference
  319.     ENDIF
  320.  
  321. ;  SRRecognizer Instance Functions 
  322. ;
  323. ; pascal OSErr SRNewRecognizer(SRRecognitionSystem system, SRRecognizer *recognizer, OSType sourceID)
  324. ;
  325.     IF ¬ GENERATINGCFM THEN
  326.         Macro
  327.         _SRNewRecognizer
  328.             move.w              #$060A,d0
  329.             dc.w                $AA56
  330.         EndM
  331.     ELSE
  332.         IMPORT_CFM_FUNCTION SRNewRecognizer
  333.     ENDIF
  334.  
  335. ;
  336. ; pascal OSErr SRStartListening(SRRecognizer recognizer)
  337. ;
  338.     IF ¬ GENERATINGCFM THEN
  339.         Macro
  340.         _SRStartListening
  341.             move.w              #$020C,d0
  342.             dc.w                $AA56
  343.         EndM
  344.     ELSE
  345.         IMPORT_CFM_FUNCTION SRStartListening
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal OSErr SRStopListening(SRRecognizer recognizer)
  350. ;
  351.     IF ¬ GENERATINGCFM THEN
  352.         Macro
  353.         _SRStopListening
  354.             move.w              #$020D,d0
  355.             dc.w                $AA56
  356.         EndM
  357.     ELSE
  358.         IMPORT_CFM_FUNCTION SRStopListening
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal OSErr SRSetLanguageModel(SRRecognizer recognizer, SRLanguageModel languageModel)
  363. ;
  364.     IF ¬ GENERATINGCFM THEN
  365.         Macro
  366.         _SRSetLanguageModel
  367.             move.w              #$040E,d0
  368.             dc.w                $AA56
  369.         EndM
  370.     ELSE
  371.         IMPORT_CFM_FUNCTION SRSetLanguageModel
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal OSErr SRGetLanguageModel(SRRecognizer recognizer, SRLanguageModel *languageModel)
  376. ;
  377.     IF ¬ GENERATINGCFM THEN
  378.         Macro
  379.         _SRGetLanguageModel
  380.             move.w              #$040F,d0
  381.             dc.w                $AA56
  382.         EndM
  383.     ELSE
  384.         IMPORT_CFM_FUNCTION SRGetLanguageModel
  385.     ENDIF
  386.  
  387. ;
  388. ; pascal OSErr SRContinueRecognition(SRRecognizer recognizer)
  389. ;
  390.     IF ¬ GENERATINGCFM THEN
  391.         Macro
  392.         _SRContinueRecognition
  393.             move.w              #$0210,d0
  394.             dc.w                $AA56
  395.         EndM
  396.     ELSE
  397.         IMPORT_CFM_FUNCTION SRContinueRecognition
  398.     ENDIF
  399.  
  400. ;
  401. ; pascal OSErr SRCancelRecognition(SRRecognizer recognizer)
  402. ;
  403.     IF ¬ GENERATINGCFM THEN
  404.         Macro
  405.         _SRCancelRecognition
  406.             move.w              #$0211,d0
  407.             dc.w                $AA56
  408.         EndM
  409.     ELSE
  410.         IMPORT_CFM_FUNCTION SRCancelRecognition
  411.     ENDIF
  412.  
  413. ;
  414. ; pascal OSErr SRIdle(void )
  415. ;
  416.     IF ¬ GENERATINGCFM THEN
  417.         Macro
  418.         _SRIdle
  419.             move.w              #$0028,d0
  420.             dc.w                $AA56
  421.         EndM
  422.     ELSE
  423.         IMPORT_CFM_FUNCTION SRIdle
  424.     ENDIF
  425.  
  426. ;  Language Model Building and Manipulation Functions 
  427. ;
  428. ; pascal OSErr SRNewLanguageModel(SRRecognitionSystem system, SRLanguageModel *model, const void *name, Size nameLength)
  429. ;
  430.     IF ¬ GENERATINGCFM THEN
  431.         Macro
  432.         _SRNewLanguageModel
  433.             move.w              #$0812,d0
  434.             dc.w                $AA56
  435.         EndM
  436.     ELSE
  437.         IMPORT_CFM_FUNCTION SRNewLanguageModel
  438.     ENDIF
  439.  
  440. ;
  441. ; pascal OSErr SRNewPath(SRRecognitionSystem system, SRPath *path)
  442. ;
  443.     IF ¬ GENERATINGCFM THEN
  444.         Macro
  445.         _SRNewPath
  446.             move.w              #$0413,d0
  447.             dc.w                $AA56
  448.         EndM
  449.     ELSE
  450.         IMPORT_CFM_FUNCTION SRNewPath
  451.     ENDIF
  452.  
  453. ;
  454. ; pascal OSErr SRNewPhrase(SRRecognitionSystem system, SRPhrase *phrase, const void *text, Size textLength)
  455. ;
  456.     IF ¬ GENERATINGCFM THEN
  457.         Macro
  458.         _SRNewPhrase
  459.             move.w              #$0814,d0
  460.             dc.w                $AA56
  461.         EndM
  462.     ELSE
  463.         IMPORT_CFM_FUNCTION SRNewPhrase
  464.     ENDIF
  465.  
  466. ;
  467. ; pascal OSErr SRNewWord(SRRecognitionSystem system, SRWord *word, const void *text, Size textLength)
  468. ;
  469.     IF ¬ GENERATINGCFM THEN
  470.         Macro
  471.         _SRNewWord
  472.             move.w              #$0815,d0
  473.             dc.w                $AA56
  474.         EndM
  475.     ELSE
  476.         IMPORT_CFM_FUNCTION SRNewWord
  477.     ENDIF
  478.  
  479. ;  Operations on any object of the SRLanguageObject family 
  480. ;
  481. ; pascal OSErr SRPutLanguageObjectIntoHandle(SRLanguageObject languageObject, Handle lobjHandle)
  482. ;
  483.     IF ¬ GENERATINGCFM THEN
  484.         Macro
  485.         _SRPutLanguageObjectIntoHandle
  486.             move.w              #$0416,d0
  487.             dc.w                $AA56
  488.         EndM
  489.     ELSE
  490.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoHandle
  491.     ENDIF
  492.  
  493. ;
  494. ; pascal OSErr SRPutLanguageObjectIntoDataFile(SRLanguageObject languageObject, short fRefNum)
  495. ;
  496.     IF ¬ GENERATINGCFM THEN
  497.         Macro
  498.         _SRPutLanguageObjectIntoDataFile
  499.             move.w              #$0328,d0
  500.             dc.w                $AA56
  501.         EndM
  502.     ELSE
  503.         IMPORT_CFM_FUNCTION SRPutLanguageObjectIntoDataFile
  504.     ENDIF
  505.  
  506. ;
  507. ; pascal OSErr SRNewLanguageObjectFromHandle(SRRecognitionSystem system, SRLanguageObject *languageObject, Handle lObjHandle)
  508. ;
  509.     IF ¬ GENERATINGCFM THEN
  510.         Macro
  511.         _SRNewLanguageObjectFromHandle
  512.             move.w              #$0417,d0
  513.             dc.w                $AA56
  514.         EndM
  515.     ELSE
  516.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromHandle
  517.     ENDIF
  518.  
  519. ;
  520. ; pascal OSErr SRNewLanguageObjectFromDataFile(SRRecognitionSystem system, SRLanguageObject *languageObject, short fRefNum)
  521. ;
  522.     IF ¬ GENERATINGCFM THEN
  523.         Macro
  524.         _SRNewLanguageObjectFromDataFile
  525.             move.w              #$0427,d0
  526.             dc.w                $AA56
  527.         EndM
  528.     ELSE
  529.         IMPORT_CFM_FUNCTION SRNewLanguageObjectFromDataFile
  530.     ENDIF
  531.  
  532. ;
  533. ; pascal OSErr SREmptyLanguageObject(SRLanguageObject languageObject)
  534. ;
  535.     IF ¬ GENERATINGCFM THEN
  536.         Macro
  537.         _SREmptyLanguageObject
  538.             move.w              #$0218,d0
  539.             dc.w                $AA56
  540.         EndM
  541.     ELSE
  542.         IMPORT_CFM_FUNCTION SREmptyLanguageObject
  543.     ENDIF
  544.  
  545. ;
  546. ; pascal OSErr SRChangeLanguageObject(SRLanguageObject languageObject, const void *text, Size textLength)
  547. ;
  548.     IF ¬ GENERATINGCFM THEN
  549.         Macro
  550.         _SRChangeLanguageObject
  551.             move.w              #$0619,d0
  552.             dc.w                $AA56
  553.         EndM
  554.     ELSE
  555.         IMPORT_CFM_FUNCTION SRChangeLanguageObject
  556.     ENDIF
  557.  
  558. ;
  559. ; pascal OSErr SRAddLanguageObject(SRLanguageObject base, SRLanguageObject addon)
  560. ;
  561.     IF ¬ GENERATINGCFM THEN
  562.         Macro
  563.         _SRAddLanguageObject
  564.             move.w              #$041A,d0
  565.             dc.w                $AA56
  566.         EndM
  567.     ELSE
  568.         IMPORT_CFM_FUNCTION SRAddLanguageObject
  569.     ENDIF
  570.  
  571. ;
  572. ; pascal OSErr SRAddText(SRLanguageObject base, const void *text, Size textLength, long refCon)
  573. ;
  574.     IF ¬ GENERATINGCFM THEN
  575.         Macro
  576.         _SRAddText
  577.             move.w              #$081B,d0
  578.             dc.w                $AA56
  579.         EndM
  580.     ELSE
  581.         IMPORT_CFM_FUNCTION SRAddText
  582.     ENDIF
  583.  
  584. ;
  585. ; pascal OSErr SRRemoveLanguageObject(SRLanguageObject base, SRLanguageObject toRemove)
  586. ;
  587.     IF ¬ GENERATINGCFM THEN
  588.         Macro
  589.         _SRRemoveLanguageObject
  590.             move.w              #$041C,d0
  591.             dc.w                $AA56
  592.         EndM
  593.     ELSE
  594.         IMPORT_CFM_FUNCTION SRRemoveLanguageObject
  595.     ENDIF
  596.  
  597. ;  Traversing SRRecognitionResults or SRLanguageObjects 
  598. ;
  599. ; pascal OSErr SRCountItems(SRSpeechObject container, long *count)
  600. ;
  601.     IF ¬ GENERATINGCFM THEN
  602.         Macro
  603.         _SRCountItems
  604.             move.w              #$0405,d0
  605.             dc.w                $AA56
  606.         EndM
  607.     ELSE
  608.         IMPORT_CFM_FUNCTION SRCountItems
  609.     ENDIF
  610.  
  611. ;
  612. ; pascal OSErr SRGetIndexedItem(SRSpeechObject container, SRSpeechObject *item, long index)
  613. ;
  614.     IF ¬ GENERATINGCFM THEN
  615.         Macro
  616.         _SRGetIndexedItem
  617.             move.w              #$0606,d0
  618.             dc.w                $AA56
  619.         EndM
  620.     ELSE
  621.         IMPORT_CFM_FUNCTION SRGetIndexedItem
  622.     ENDIF
  623.  
  624. ;
  625. ; pascal OSErr SRSetIndexedItem(SRSpeechObject container, SRSpeechObject item, long index)
  626. ;
  627.     IF ¬ GENERATINGCFM THEN
  628.         Macro
  629.         _SRSetIndexedItem
  630.             move.w              #$0607,d0
  631.             dc.w                $AA56
  632.         EndM
  633.     ELSE
  634.         IMPORT_CFM_FUNCTION SRSetIndexedItem
  635.     ENDIF
  636.  
  637. ;
  638. ; pascal OSErr SRRemoveIndexedItem(SRSpeechObject container, long index)
  639. ;
  640.     IF ¬ GENERATINGCFM THEN
  641.         Macro
  642.         _SRRemoveIndexedItem
  643.             move.w              #$0408,d0
  644.             dc.w                $AA56
  645.         EndM
  646.     ELSE
  647.         IMPORT_CFM_FUNCTION SRRemoveIndexedItem
  648.     ENDIF
  649.  
  650. ;  Utilizing the System Feedback Window 
  651. ;
  652. ; pascal OSErr SRDrawText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  653. ;
  654.     IF ¬ GENERATINGCFM THEN
  655.         Macro
  656.         _SRDrawText
  657.             move.w              #$0621,d0
  658.             dc.w                $AA56
  659.         EndM
  660.     ELSE
  661.         IMPORT_CFM_FUNCTION SRDrawText
  662.     ENDIF
  663.  
  664. ;
  665. ; pascal OSErr SRDrawRecognizedText(SRRecognizer recognizer, const void *dispText, Size dispLength)
  666. ;
  667.     IF ¬ GENERATINGCFM THEN
  668.         Macro
  669.         _SRDrawRecognizedText
  670.             move.w              #$0622,d0
  671.             dc.w                $AA56
  672.         EndM
  673.     ELSE
  674.         IMPORT_CFM_FUNCTION SRDrawRecognizedText
  675.     ENDIF
  676.  
  677. ;
  678. ; pascal OSErr SRSpeakText(SRRecognizer recognizer, const void *speakText, Size speakLength)
  679. ;
  680.     IF ¬ GENERATINGCFM THEN
  681.         Macro
  682.         _SRSpeakText
  683.             move.w              #$0620,d0
  684.             dc.w                $AA56
  685.         EndM
  686.     ELSE
  687.         IMPORT_CFM_FUNCTION SRSpeakText
  688.     ENDIF
  689.  
  690. ;
  691. ; pascal OSErr SRSpeakAndDrawText(SRRecognizer recognizer, const void *text, Size textLength)
  692. ;
  693.     IF ¬ GENERATINGCFM THEN
  694.         Macro
  695.         _SRSpeakAndDrawText
  696.             move.w              #$061F,d0
  697.             dc.w                $AA56
  698.         EndM
  699.     ELSE
  700.         IMPORT_CFM_FUNCTION SRSpeakAndDrawText
  701.     ENDIF
  702.  
  703. ;
  704. ; pascal OSErr SRStopSpeech(SRRecognizer recognizer)
  705. ;
  706.     IF ¬ GENERATINGCFM THEN
  707.         Macro
  708.         _SRStopSpeech
  709.             move.w              #$0223,d0
  710.             dc.w                $AA56
  711.         EndM
  712.     ELSE
  713.         IMPORT_CFM_FUNCTION SRStopSpeech
  714.     ENDIF
  715.  
  716. ;
  717. ; pascal Boolean SRSpeechBusy(SRRecognizer recognizer)
  718. ;
  719.     IF ¬ GENERATINGCFM THEN
  720.         Macro
  721.         _SRSpeechBusy
  722.             move.w              #$0224,d0
  723.             dc.w                $AA56
  724.         EndM
  725.     ELSE
  726.         IMPORT_CFM_FUNCTION SRSpeechBusy
  727.     ENDIF
  728.  
  729. ;
  730. ; pascal OSErr SRProcessBegin(SRRecognizer recognizer, Boolean failed)
  731. ;
  732.     IF ¬ GENERATINGCFM THEN
  733.         Macro
  734.         _SRProcessBegin
  735.             move.w              #$031D,d0
  736.             dc.w                $AA56
  737.         EndM
  738.     ELSE
  739.         IMPORT_CFM_FUNCTION SRProcessBegin
  740.     ENDIF
  741.  
  742. ;
  743. ; pascal OSErr SRProcessEnd(SRRecognizer recognizer, Boolean failed)
  744. ;
  745.     IF ¬ GENERATINGCFM THEN
  746.         Macro
  747.         _SRProcessEnd
  748.             move.w              #$031E,d0
  749.             dc.w                $AA56
  750.         EndM
  751.     ELSE
  752.         IMPORT_CFM_FUNCTION SRProcessEnd
  753.     ENDIF
  754.  
  755.     ENDIF ; __SPEECHRECOGNITION__ 
  756.  
  757.